<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Category Administrator Control Panel</title>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>
<body>

<jsp:include page="common/header.jsp"/>

<%@page language="java" import="OnlineExam.*, registration.*, java.util.*"%>
<% 
	User user = (User)session.getAttribute ("USER");
	String categoryId = request.getParameter ("Category");
	System.out.println ("The Category id in CategoryControlPanel..." + categoryId);
	Category cat = Category.retrieveCategory (categoryId);
	session.setAttribute ("CATEGORY",cat);
%>
<b><center>Category Admin : <%= cat.getCategoryAdmin() %></center></b> 
<br /><b><center>Action to perform </b></center>
<br>

<center><b> Category : <%=cat.getCategoryId() %> </b></center><br /><br />
<center><table><tr><td>

	<form action="QuestionAttributes.jsp" method="get">
		<input type="Submit" value="Add Question">
	</form>

	</td><td>
	
	<form action="QuestionViewer.jsp" method="get">
		<input type="Submit" value="View The Question Bank">
	</form>
	
	</td><td>
	
	<form action="ViewTests.jsp" method="get">
		<input type="Submit" value="View All Tests">
	</form>
	</td></tr></table></center>
	
	<br /><br />

	<html:form action="/jsp/CategoryControlPanel.do">

		<center><tr><td><b>Set the Test Length</b></td>
		<td><html:text property="testLength" value="<%=Integer.toString(cat.getTestLength())%>" size="3" /></td><br /><br />

		<td><b>Set the Time Limit </b></td>
		<td><html:text property="timeLimit" value="<%=Integer.toString(cat.getTimeLimit())%>" size="3" /></td></tr> <br /><br />

		<b>Current Question Generation Type is <%=cat.getQuestionGeneration()%> </b><br /><br />
		<tr><td><html:radio property="questionGeneration" value="Random" />Random</td>

		<td><html:radio property="questionGeneration" value="Simple" /> Simple</td></tr>

		<tr><td><html:submit /></td></tr></center>
	</html:form>
	
<br /><br />

<br>
<center>

<hr /><br />
<jsp:include page="common/footer.jsp"/>

</body>
</html>
